package com.xbongbong.saas.service;


import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.pojo.FieldAttrEntityForImport;
import com.xbongbong.paas.pojo.dto.FormDataAddDTO;
import com.xbongbong.paas.pojo.dto.ImportFormDataDTO;
import com.xbongbong.paas.pojo.dto.SaasFormSaveDTO;
import com.xbongbong.paas.pojo.imports.CellTitlePojo;
import com.xbongbong.paas.pojo.imports.RowGroupPojo;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.pro.competitor.pojo.dto.CompetitorDeleteBatchDTO;
import com.xbongbong.pro.competitor.pojo.dto.CompetitorDeleteBatchVO;
import com.xbongbong.pro.competitor.pojo.dto.CompetitorEditAttrUpdateDTO;
import com.xbongbong.pro.competitor.pojo.dto.CompetitorPanoramaGetDTO;
import com.xbongbong.pro.competitor.pojo.dto.CompetitorUpdateBatchDTO;
import com.xbongbong.pro.competitor.pojo.dto.CompetitorUserAndDeptGetDTO;
import com.xbongbong.pro.competitor.pojo.dto.LinkedOpportunityListDTO;
import com.xbongbong.pro.competitor.pojo.vo.CompetitorPanoramaGetVO;
import com.xbongbong.pro.competitor.pojo.vo.CompetitorUpdateBatchVO;
import com.xbongbong.pro.competitor.pojo.vo.CompetitorUserAndDeptGetVO;
import com.xbongbong.pro.competitor.pojo.vo.LinkedOpportunityListVO;
import com.xbongbong.pro.listbatch.pojo.dto.AddLabelDTO;
import com.xbongbong.pro.listbatch.pojo.dto.PortionDepDTO;
import com.xbongbong.pro.listbatch.pojo.dto.PortionUserDTO;

import java.util.List;

/**
 * @author: yingjf
 * @date: 2022/8/11 11:13
 * @description: 竞争对手业务接口
 */
public interface CompetitorService extends SaasSaveService {

    /**
     * @param competitorEditAttrUpdateDTO
     * @Description: 批量修改字段
     * @return: void
     * @throws:
     */
    void batchEditAttr(CompetitorEditAttrUpdateDTO competitorEditAttrUpdateDTO) throws XbbException;


    /**
     * @param competitorUpdateBatchDTO
     * @Description: 批量修改竞争对手
     * @return: com.xbongbong.pro.competitor.pojo.vo.CompetitorUpdateBatchVO
     * @throws:
     */
    CompetitorUpdateBatchVO updateBatch(CompetitorUpdateBatchDTO competitorUpdateBatchDTO) throws XbbException;

    void afterSaveForWorkflow(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;

    void afterSaveForUpdateWorkflow(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;

    /**
     * 批量删除竞争对手
     *
     * @param competitorDeleteBatchDTO
     * @return CompetitorDeleteBatchVO
     * @throws XbbException
     */
    CompetitorDeleteBatchVO deleteBatch(CompetitorDeleteBatchDTO competitorDeleteBatchDTO) throws XbbException;

    /**
     * 竞争对手全景图
     * date: 2022/8/22 3:49 下午
     *
     * @param competitorPanoramaGetDTO:
     * @author yingjf
     */
    CompetitorPanoramaGetVO panoramaGet(CompetitorPanoramaGetDTO competitorPanoramaGetDTO) throws XbbException;

    /**
     * tab获取可见范围
     * date: 2022/8/23 4:20 下午
     *
     * @param competitorUserAndDeptGetDTO:
     * @author yingjf
     */
    CompetitorUserAndDeptGetVO userAndDeptGet(CompetitorUserAndDeptGetDTO competitorUserAndDeptGetDTO) throws XbbException;

    /**
     * 批量分配部门
     * date: 2022/8/23 6:28 下午
     *
     * @param portionDepDTO:
     * @author yingjf
     */
    BaseVO portionDep(PortionDepDTO portionDepDTO) throws XbbException;

    /**
     * 批量分配用户
     * date: 2022/8/23 6:28 下午
     *
     * @param portionUserDTO:
     * @author yingjf
     */
    BaseVO portionUser(PortionUserDTO portionUserDTO) throws XbbException;

    /**
     * 获取关联销售机会
     * date: 2022/8/23 7:09 下午
     *
     * @param linkedOpportunityListDTO:
     * @author yingjf
     */
    LinkedOpportunityListVO linkedOpportunityList(LinkedOpportunityListDTO linkedOpportunityListDTO) throws XbbException;

    /**
     * 将Excel数据格式化成表单保存需要的JSON格式的数据
     *
     * @param importFormDataDTO 导入入参
     * @param titlePojoList     标题
     * @param rowGroupPojo      一个表单对应的一组Excel填写的数据
     * @param fieldAttrList     解释
     * @return FormDataAddDTO
     * @throws XbbException XbbException
     * @author gaojie
     * @since V1.0
     */
    FormDataAddDTO formatExcelValue(ImportFormDataDTO importFormDataDTO, List<CellTitlePojo> titlePojoList, RowGroupPojo rowGroupPojo, List<FieldAttrEntityForImport> fieldAttrList) throws XbbException;

    /**
     * 批量打标签
     *
     * @param addLabelDTO
     * @param addBatchList
     * @param addOrDelete
     * @throws XbbException
     */
    void updateBatchLabelAttr(AddLabelDTO addLabelDTO, List<PaasFormDataEntityExt> addBatchList, Boolean addOrDelete) throws XbbException;

}
